#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QImage>
#include <QMouseEvent>
#include <QPen>
#include<QPainter>
#include<QPixmap>
namespace Ui {
class MainWindow;
}

class resistence
{
public:
    int rv;
    resistence() {}
};
class line
{
public:
    QPoint initialpoint;
    QPoint endpoint;
    //resistence R[10];
    int owner[2]={99,99};
    double trv=0;
    double tsv=0;
    double tjv=0;
    double tsjv=0;

};
//class round
//{
//public:
    //line l[4];
   // int source[4];
//};


class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
    virtual void paintEvent(QPaintEvent *);
    virtual void mousePressEvent(QMouseEvent *event);
    virtual void mouseReleaseEvent(QMouseEvent *event);
    virtual void mouseMoveEvent(QMouseEvent *event);
    virtual void mouseclickEvent(QMouseEvent *event);
    int count;

private slots:
    void on_pushButton_clicked();

    void on_pushButton_2_clicked();

    void on_pushButton_3_clicked();

    void on_pushButton_4_clicked();

    void on_pushButton_5_clicked();

    void on_pushButton_6_clicked();

    void on_pushButton_7_clicked();

    void on_pushButton_8_clicked();

    void on_pushButton_9_clicked();

    void on_pushButton_10_clicked();

    void on_pushButton_11_clicked();

    void on_pushButton_12_clicked();

private:
    Ui::MainWindow *ui;
    bool isDrawing;
    QPoint inipoint;
    QPoint edpoint;
    QImage* image;
    int DrawType;
    QPoint rcenter;
    QImage* image2;
    line L[16];
    int cntpa[4000];
    int cntpb[4000];
    int countline=0;
   // bool preround;
    int countround=0;
    int lfer=0;
   // class round r[10];
    int countr[15];//数第i条线上电阻数
    double a[10][10]={{0}};
    double z[10][10]={{0}};
    bool flag=0;
    double b2[10]={0};
    double b4[10]={0};
    double t[10];
    int net=0;
    double tempr=0;
    double temps=0;
    double tempj=0;
    double tempsj=0;
    QPoint capcenter;
    QPixmap induimg;
    QPixmap induimg2;
    QPoint inducenter;
    bool reactance;
    double c3[10][10]={{0}};
    double hou[10][10]={{0}};
    double ss[10]={0};
     double xx[10]={0};
     double sx[10]={0};
     double xs[10]={0};
     double fins[10]={0};
     double finx[10]={0};
     bool clean=0;
};

#endif // MAINWINDOW_H
